Skip to content

Conversation

@gproly
Copy link
Contributor

@gproly gproly commented Feb 10, 2026

Description:
feat(end event): support Mustache in external URL for element destination

  • Resolve Mustache expressions in end event "External URL" when the token reaches the end event, using the same context as scripts/screens (APP_URL, _request, _user, process variables).
  • Add getElementDestinationMustacheContext() to build context via DataManager with fallback; normalize to plain array for Mustache.
  • Add resolveElementDestinationUrl() to decode HTML entities and render URL template with MustacheExpressionEvaluator. FEEL is not supported.
  • Apply resolution only for externalURL type; conditional redirect URLs also go through Mustache when destination is external URL.
  • Harden getElementDestinationAttribute(): ensure conditionalRedirectProp and elementDestinationProp are never null (json_decode ?? [], pass ?? []).
  • Modeler: allow URL validation when string contains {{ (Mustache); update helper and error copy to document _request.id, _user.id, process vars.

Related tickets:
https://processmaker.atlassian.net/browse/FOUR-29250

Description:
feat(end event): support Mustache in external URL for element destination

- Resolve Mustache expressions in end event "External URL" when the token
  reaches the end event, using the same context as scripts/screens
  (APP_URL, _request, _user, process variables).
- Add getElementDestinationMustacheContext() to build context via DataManager
  with fallback; normalize to plain array for Mustache.
- Add resolveElementDestinationUrl() to decode HTML entities and render
  URL template with MustacheExpressionEvaluator. FEEL is not supported.
- Apply resolution only for externalURL type; conditional redirect URLs
  also go through Mustache when destination is external URL.
- Harden getElementDestinationAttribute(): ensure conditionalRedirectProp
  and elementDestinationProp are never null (json_decode ?? [], pass ?? []).
- Modeler: allow URL validation when string contains {{ (Mustache); update
  helper and error copy to document _request.id, _user.id, process vars.
Related tickets:
https://processmaker.atlassian.net/browse/FOUR-29250
@cypress
Copy link

cypress bot commented Feb 10, 2026

modeler    Run #1764

Run Properties:  status check failed Failed #1764  •  git commit 0cd0e4ea80: FOUR-29250 End Event – External URL with Mustache/FEEL Support
Project modeler
Branch Review feature/FOUR-29250
Run status status check failed Failed #1764
Run duration 04m 11s
Commit git commit 0cd0e4ea80: FOUR-29250 End Event – External URL with Mustache/FEEL Support
Committer Roly Rudy Gutierrez Pinto
View all properties for this run ↗︎

Test results
Tests that failed  Failures 1
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 14
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 191
View all changes introduced in this branch ↗︎

Tests for review

Failed  StartTimerEvent.cy.js • 1 failed test

View Output

Test Artifacts
Start Timer Event > can set a specific end date Test Replay Screenshots
Failed  zoomControl/ZoomControl.cy.js • 0 failed tests

View Output

Test Artifacts
Failed  undoRedoControl/UndoRedoControl.cy.js • 0 failed tests

View Output

Test Artifacts
Failed  publishControl/PublishControl.cy.js • 0 failed tests

View Output

Test Artifacts
Failed  BoundaryEventValidation.cy.js • 0 failed tests

View Output

Test Artifacts

The first 5 failed specs are shown, see all 73 specs in Cypress Cloud.

…pector to display element configuration data (formData) as key-value pairs with keyboard-accessible toggle.
@processmaker-sonarqube
Copy link

Quality Gate failed Quality Gate failed

Failed conditions
2 New Code Smells (required ≤ 0)
B Reliability Rating on New Code (required ≥ A)
1 New Bugs (required ≤ 0)

See analysis details on SonarQube

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE SonarQube for IDE

return '';
},
isValidURL(string) {
if (!string || typeof string !== 'string') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

null, undefined, 123, {}, [] will be valid for a isValidURL method

return true;
}
// Allow Mustache: same context as backend (APP_URL, _request, _user, process variables)
if (string.includes('{{')) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"{{"
"{{invalid"
"hello {{"

will be evaluated as a valid value, try a regEx patern
example

const mustachePattern = /{{\s*[^}]+\s*}}/;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants